﻿using System;
using ClientOverflow.ViewModels.Interfaces;
using ClientOverflow.ViewModels.Login;

namespace ClientOverflow.ViewModels.MainMenus
{
    /// <summary>
    /// LoginCommand sets the view to Login state.
    /// </summary>
    public class LoginCommand : INamedCommand
    {
        private readonly IMenusViewModel viewModel;

        public LoginCommand(IMenusViewModel viewModel)
        {
            this.viewModel = viewModel;
        }

        public string Name
        {
            get { return "Login"; }
        }

        public void Execute(object parameter)
        {
            viewModel.Content = new LoginViewModel();

        }

        public bool CanExecute(object parameter)
        {
            return true;
        }

        public event EventHandler CanExecuteChanged;
    }
}